<?php

namespace App\Transformers\Auth\Module;

use App\Entities\Auth\Module;
use League\Fractal\TransformerAbstract;

class TreeTransformer extends TransformerAbstract
{
    public function transform(Module $model)
    {
        return [
            'id' => $model->module_id,
            'type' => 'module',
            'parent_id' => $model->parent_id,
            'label' => 'module_'.$model->module_id,
            'name' => $model->full_name,
            'route' => $model->url_address,
            // 'icon' => $model->icon,
            // 'target' => $model->target,
            // Module::STATUS => $model->ToBool(Module::STATUS),
        ];
    }
}
